<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎访问产品运营互动中心！</title>
<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<link href="<s:url value="/images/08_ccxxzx.css"/>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript"
	src="<s:url value="/components/datepicker/WdatePicker.js"/>">
</script>
<script src="<s:url value="/script/jquery_last.js"/>" type="text/javascript"></script>
<script src="<s:url value="/script/formValidator.js"/>" type="text/javascript" charset="UTF-8"></script>
<script src="<s:url value="/script/formValidatorRegex.js"/>" type="text/javascript" charset="UTF-8"></script>
<script language="javascript" src="<s:url value="/script/DateTimeMask.js"/>" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({autotip:true,onerror:function(msg){alert(msg)}});
	$("input:text[name='productSort.name']").formValidator({tipid:"nametip",onshow:"请选择名称"}).inputValidator({min:1,onerror:"您还没有填写名称",empty:{leftempty:false,rightempty:false,emptyerror:"名称两边不能有空符号"}});
});
</script>
<script language="javascript" src="<s:url value="/script/ShowProcessBar.js"/>" type="text/javascript"></script>

<link rel="stylesheet" href="<s:url value="/css/validator.css"/>">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				background="<s:url value="/images/new/gxzl_index_2.gif"/>">
				<tr>
					<td width="20" height="32">&nbsp;</td>
					<td width="20"><img
						src="<s:url value="/images/new/dq_dot.gif"/>" width="15"
						height="12" /></td>
					<td>当前位置：产品目录维护</td>
				</tr>
			</table>
			</td>
		</tr>
  <tr> 
    <td background="<s:url value="/images/home_4a.gif"/>"> 
      <table width="100%" height="400" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
        <tr>
          <td width="240" valign="top" class="leftbg">
		   <%@ include file="/commons/include/catalog_left.inc"%>  
   		  </td>
          <td valign="top"><br>
            <s:form action="saveProductSort.action"   id="form1"  method="post" onsubmit="save();return $.formValidator.pageIsValid('1');"  enctype="multipart/form-data" >
					<input type="hidden" name="productSort.id" value="${productSort.id}">
					<table width=98% align="center" border="0" cellspacing="0" cellpadding="0" >
						<tr>
							<td height="5">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab1.gif"/>" width="5" height="5" /></td>
										<td class="tdborderup"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
										<td width="5"><img src="<s:url value="/images/cphdzx_tab2.gif"/>" width="5" height="5" /></td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td class=tdborderleftright>
							<TABLE width="98%" cellSpacing=1 cellPadding=0 align="center">
								<TR height=30>
									<TD align=left width="10%">
										<input type="submit"
										name="Submit" value="保 存"> 
										<input type="button" value="返 回"
										onClick="location.href='listProductSort.action'">
										<s:if test="productSort.id!=null">
											<input type="button" value="继续添加" onClick="location.href='editProductSort.action'">
										</s:if>
									</TD>
								</TR>
							</table>
							<s:if test="#returnMsg==null">
							</s:if>
							<s:else>
							<TABLE width="98%" cellSpacing=1 cellPadding=0 align="center">
								<TR height=30>
									<TD align=left width="10%">
										<font color="red">${returnMsg}</font>
									</TD>
								</TR>
							</table>
							</s:else>
							<table width="98%" border="0" cellspacing="0" cellpadding="7"
								align="center" class=tablecolor2>
								<tr>
									<td width="19%" bgcolor="D6E3FA">
									<div align="right"><font color="red">*</font>名&nbsp;&nbsp;&nbsp;&nbsp;称：</div>
									</td>
									<td width="81%"><s:textfield name="productSort.name" theme="css_xhtml"/><div id="nametip" style="width:auto"></div></td>
								</tr>
                                <tr>
									<td width="19%" bgcolor="D6E3FA">
									<div align="right"><font color="red">*</font>目录类型：</div>
									</td>
									<td width="81%">
										<select name="productSort.sortType" style="width:155px">
											<option value="1">集团产品目录</option>
											<option value="2">福建省产品目录</option>
										</select>
									</td>
								</tr>
								<tr> 
				                    <td width="19%" bgcolor="D6E3FA"> 
				                      <div align="right">所属目录： </div>
				                    </td>
				                    <td width="81%">
				                      <input type="hidden" name="productSort.parentSort" value="${productSort.parentSort}">
				                      <input type="text" name="productSort.parentName" readonly value="${productSort.parentName}" size="55">
									  <input type="button" name="selType" value="选择目录" onClick="showTypeDialog()"/>
				                    </td>
				                </tr>
				                <input type="hidden" name="productSort.creator"
										value="${productSort.creator}">
				                <input type="hidden" name="productSort.begin" value="<s:date name="productSort.begin" format="yyyy-MM-dd HH:mm:ss"/>" >
				                <input type="hidden" name="productSort.end" value="<s:date name="productSort.end" format="yyyy-MM-dd HH:mm:ss"/>" >
								<tr>
									<td width="19%" bgcolor="D6E3FA">
									<div align="right">备&nbsp;&nbsp;&nbsp;&nbsp;注：</div>
									</td>
									<td width="81%"><s:textarea name="productSort.description"  theme="css_xhtml"/></td>
								</tr>
							</table>
							</td>
						</tr>
						<tr>
							<td height="5">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab3.gif"/>" width="5" height="5" /></td>
										<td class="tdborderbottom"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
										<td width="5"><img src="<s:url value="/images/cphdzx_tab4.gif"/>" width="5" height="5" /></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		</s:form>
</body>
</html>
<script>
if("${productSort.sortType}"==2){
	document.forms[0]["productSort.sortType"].options[1].selected=true;
}
function showTypeDialog(){
     //var url="<s:url value='/' escapeAmp='false'/>"+"xtreecheckbox/selectProductSort.jsp?type=radio&sortType=1&date=<%=System.currentTimeMillis()%>";
	var url='<s:url value="/xtreecheckbox/selectProductSort.jsp?type=radio&sortType=1&date=" escapeAmp="false"/>'+'<%=System.currentTimeMillis()%>';
     if(document.forms[0]["productSort.sortType"].value==2){
			url='<s:url value="/xtreecheckbox/selectProductSort.jsp?type=radio&sortType=2&date=" escapeAmp="false"/>'+'<%=System.currentTimeMillis()%>';
     	//url="<s:url value='/' escapeAmp='false'/>"+"/xtreecheckbox/selectProductSort.jsp?type=radio&sortType=2&date=<%=System.currentTimeMillis()%>";
     }
    //alert(url);
	 var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:450px;dialogHeight:600px;scroll:yes;");
	 if(returnData){
	 	document.forms[0]["productSort.parentName"].value=returnData[1];
	 	document.forms[0]["productSort.parentSort"].value=returnData[0];
	 }
}
function save(){
    if(form1["productSort.name"].value==""){
    	alert("福建省产品目录不能为空，请在光标处输入！");
    	form1["productSort.name"].focus();
    	return;
    }
    
	if(form1["productSort.parentSort"].value==""){
		form1["productSort.parentSort"].value="0";
	}
}
var obj1=document.getElementById("iTR3");
if(obj1){
	obj1.style.backgroundColor="B3DEF4";
}
</script>
